import request from '@/utils/request'

// 查询课程用户映射列表
export function listUserCourse(query) {
  return request({
    url: '/business/userCourse/list',
    method: 'get',
    params: query
  })
}

// 查询课程用户映射详细
export function getUserCourse(id) {
  return request({
    url: '/business/userCourse/' + id,
    method: 'get'
  })
}

// 新增课程用户映射
export function addUserCourse(data) {
  return request({
    url: '/business/userCourse',
    method: 'post',
    data: data
  })
}

// 修改课程用户映射
export function updateUserCourse(data) {
  return request({
    url: '/business/userCourse',
    method: 'put',
    data: data
  })
}

// 删除课程用户映射
export function delUserCourse(id) {
  return request({
    url: '/business/userCourse/' + id,
    method: 'delete'
  })
}

// 查询用户订阅状态
export function isSubScribe(courseId) {
  return request({
    url: '/business/userCourse/isSubScribe',
    params: {
      courseId: courseId
    },
    method: 'get'
  })
}
